<%@ Page Language="C#" Theme="Defaultsys" AutoEventWireup="true" CodeFile="TemplateList.aspx.cs"
    Inherits="LetterTemplateList" Title="Rapport Plan System - Template list" MasterPageFile="~/MasterPage.master" %>

<%@ MasterType VirtualPath="~/MasterPage.master" %>
<asp:Content runat="server" ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1">
    <table border="0" width="100%" cellpadding="0" cellspacing="0">
        <tr>
            <td class="contTable">
                <asp:GridView ID="grdTemplates" SkinID="gvGrid" runat="server" AutoGenerateColumns="false"
                    AllowPaging="true" OnRowCommand="Command" OnRowDataBound="RowDataBound" Width="100%"
                    OnPageIndexChanging="grdTemplates_PageIndexChanging">
                    <Columns>
                        <asp:TemplateField HeaderText="ID" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"
                            HeaderStyle-Width="3%">
                            <ItemTemplate>
                                <%# Container.DataItemIndex + 1 %>
                            </ItemTemplate>
                        </asp:TemplateField>
                        
                        <asp:BoundField HeaderText="Template" DataField="Name" SortExpression="Name" 
                            HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left"
                            HeaderStyle-Width="75%" />
                            
                        <asp:TemplateField HeaderText="Edit" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <asp:Button ID="btnEdit" runat="server" Text="Edit" CommandArgument='<%# Eval("TemplateId") %>' />
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center" />
                        </asp:TemplateField>
                        
                        <asp:TemplateField HeaderText="Remove" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <asp:Button ID="btnRemove" runat="server" Text="Remove" CommandArgument='<%# Eval("TemplateId") %>' />
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Center" />
                        </asp:TemplateField>
                    </Columns>
                    <EmptyDataTemplate>
                        There are currently no template.</EmptyDataTemplate>
                    <PagerStyle VerticalAlign="Middle" HorizontalAlign="Left" Wrap="False" CssClass="paging"
                        Font-Bold="True"></PagerStyle>
                    <PagerSettings Mode="NumericFirstLast" />
                </asp:GridView>
                <asp:Button ID="btnAddNewTemplate" runat="server" OnClick="AddNewLetterTemplate"
                    Text="Add new template" />
            </td>
        </tr>
    </table>
</asp:Content>
